//
//  MYY_walletTopView.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/1.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYY_walletTopView.h"
#import "MYY_Me_Macro.h"

@interface MYY_walletTopView()
@property(nonatomic, strong) UIButton *RechargeButton;
@property(nonatomic, strong) UIImageView *BGView;

@end

@implementation MYY_walletTopView


-(id)init
{
    self = [super init];
    
    if (self) {
        self.backgroundColor =[UIColor whiteColor];
         [self addSubview:self.BGView];
        [self addSubview:self.RechargeButton];
       
      
        
        [_BGView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.and.right.equalTo(self).with.offset(0);
            make.top.equalTo(self).offset(0);
            make.bottom.equalTo(self).with.offset(0);
        }];
        
        
        [_RechargeButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_BGView).with.offset(40);
            make.height.equalTo(@44);
            make.width.mas_equalTo(WIDTH-60);
            make.bottom.equalTo(self.mas_bottom).offset(-20);
        }];
        
    }
    
    return self;
}
#pragma mark - property


- (UIButton *)RechargeButton
{
    if (_RechargeButton == nil) {
        _RechargeButton = [[UIButton alloc] init];
        [_RechargeButton setBackgroundColor:MYYheadColor];
        _RechargeButton.clipsToBounds = YES;
        _RechargeButton.layer.cornerRadius = 21;
        [_RechargeButton setTitle:@"立即充值" forState:UIControlStateNormal];
        [_RechargeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_RechargeButton addTarget:self action:@selector(XPWithdrawalsBu) forControlEvents:UIControlEventTouchUpInside];
        _RechargeButton.titleLabel.font =[UIFont systemFontOfSize:15];
        
        
        
    }
    return _RechargeButton;
}

-(void)XPWithdrawalsBu
{
    self.RechargeB();
}

- (UIImageView *)BGView
{
    if (_BGView == nil) {
        _BGView = [[UIImageView alloc] init];
        _BGView.backgroundColor = [UIColor clearColor];
        _BGView.image =[UIImage imageNamed:@"beijingtu"];
    }
    return _BGView;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
